3.4 \(\int \frac{A+B x}{\left (a+b x+c x^2\right ) \left (d+f x^2\right )} \, dx\)

Optimal. Leaf size=274 \[ \frac{\log \left (a+b x+c x^2\right ) (-a B f+A b f+B c d)}{2 \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )}-\frac{\log \left (d+f x^2\right ) (-a B f+A b f+B c d)}{2 \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )}+\frac{\sqrt{f} \tan ^{-1}\left (\frac{\sqrt{f} x}{\sqrt{d}}\right ) (a A f-A c d+b B d)}{\sqrt{d} \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (2 A c (c d-a f)-b B (a f+c d)+A b^2 f\right )}{\sqrt{b^2-4 a c} \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )} \]

[Out]

(Sqrt[f]*(b*B*d - A*c*d + a*A*f)*ArcTan[(Sqrt[f]*x)/Sqrt[d]])/(Sqrt[d]*(c^2*d^2
- 2*a*c*d*f + f*(b^2*d + a^2*f))) - ((A*b^2*f + 2*A*c*(c*d - a*f) - b*B*(c*d + a
*f))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(Sqrt[b^2 - 4*a*c]*(c^2*d^2 - 2*a*c
*d*f + f*(b^2*d + a^2*f))) + ((B*c*d + A*b*f - a*B*f)*Log[a + b*x + c*x^2])/(2*(
c^2*d^2 - 2*a*c*d*f + f*(b^2*d + a^2*f))) - ((B*c*d + A*b*f - a*B*f)*Log[d + f*x
^2])/(2*(c^2*d^2 - 2*a*c*d*f + f*(b^2*d + a^2*f)))

_______________________________________________________________________________________

Rubi [A]  time = 0.651443, antiderivative size = 274, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.259 \[ \frac{\log \left (a+b x+c x^2\right ) (-a B f+A b f+B c d)}{2 \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )}-\frac{\log \left (d+f x^2\right ) (-a B f+A b f+B c d)}{2 \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )}+\frac{\sqrt{f} \tan ^{-1}\left (\frac{\sqrt{f} x}{\sqrt{d}}\right ) (a A f-A c d+b B d)}{\sqrt{d} \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )}-\frac{\tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right ) \left (2 A c (c d-a f)-b B (a f+c d)+A b^2 f\right )}{\sqrt{b^2-4 a c} \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )} \]

Antiderivative was successfully verified.

[In]  Int[(A + B*x)/((a + b*x + c*x^2)*(d + f*x^2)),x]

[Out]

(Sqrt[f]*(b*B*d - A*c*d + a*A*f)*ArcTan[(Sqrt[f]*x)/Sqrt[d]])/(Sqrt[d]*(c^2*d^2
- 2*a*c*d*f + f*(b^2*d + a^2*f))) - ((A*b^2*f + 2*A*c*(c*d - a*f) - b*B*(c*d + a
*f))*ArcTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(Sqrt[b^2 - 4*a*c]*(c^2*d^2 - 2*a*c
*d*f + f*(b^2*d + a^2*f))) + ((B*c*d + A*b*f - a*B*f)*Log[a + b*x + c*x^2])/(2*(
c^2*d^2 - 2*a*c*d*f + f*(b^2*d + a^2*f))) - ((B*c*d + A*b*f - a*B*f)*Log[d + f*x
^2])/(2*(c^2*d^2 - 2*a*c*d*f + f*(b^2*d + a^2*f)))

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((B*x+A)/(c*x**2+b*x+a)/(f*x**2+d),x)

[Out]

Timed out

_______________________________________________________________________________________

Mathematica [A]  time = 0.76498, size = 212, normalized size = 0.77 \[ \frac{\sqrt{d} \left (\sqrt{4 a c-b^2} (-a B f+A b f+B c d) \left (\log (a+x (b+c x))-\log \left (d+f x^2\right )\right )+2 \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right ) \left (2 A c (c d-a f)-b B (a f+c d)+A b^2 f\right )\right )+2 \sqrt{f} \sqrt{4 a c-b^2} \tan ^{-1}\left (\frac{\sqrt{f} x}{\sqrt{d}}\right ) (a A f-A c d+b B d)}{2 \sqrt{d} \sqrt{4 a c-b^2} \left (f \left (a^2 f+b^2 d\right )-2 a c d f+c^2 d^2\right )} \]

Antiderivative was successfully verified.

[In]  Integrate[(A + B*x)/((a + b*x + c*x^2)*(d + f*x^2)),x]

[Out]

(2*Sqrt[-b^2 + 4*a*c]*Sqrt[f]*(b*B*d - A*c*d + a*A*f)*ArcTan[(Sqrt[f]*x)/Sqrt[d]
] + Sqrt[d]*(2*(A*b^2*f + 2*A*c*(c*d - a*f) - b*B*(c*d + a*f))*ArcTan[(b + 2*c*x
)/Sqrt[-b^2 + 4*a*c]] + Sqrt[-b^2 + 4*a*c]*(B*c*d + A*b*f - a*B*f)*(-Log[d + f*x
^2] + Log[a + x*(b + c*x)])))/(2*Sqrt[-b^2 + 4*a*c]*Sqrt[d]*(c^2*d^2 - 2*a*c*d*f
 + f*(b^2*d + a^2*f)))

_______________________________________________________________________________________

Maple [B]  time = 0.012, size = 745, normalized size = 2.7 \[{\frac{\ln \left ( c{x}^{2}+bx+a \right ) Abf}{2\,{a}^{2}{f}^{2}-4\,acdf+2\,{b}^{2}df+2\,{c}^{2}{d}^{2}}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) Baf}{2\,{a}^{2}{f}^{2}-4\,acdf+2\,{b}^{2}df+2\,{c}^{2}{d}^{2}}}+{\frac{c\ln \left ( c{x}^{2}+bx+a \right ) Bd}{2\,{a}^{2}{f}^{2}-4\,acdf+2\,{b}^{2}df+2\,{c}^{2}{d}^{2}}}-2\,{\frac{Aacf}{ \left ({a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2} \right ) \sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{A{b}^{2}f}{{a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+2\,{\frac{A{c}^{2}d}{ \left ({a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2} \right ) \sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{Babf}{{a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{Bbcd}{{a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}-{\frac{f\ln \left ( f{x}^{2}+d \right ) Ab}{2\,{a}^{2}{f}^{2}-4\,acdf+2\,{b}^{2}df+2\,{c}^{2}{d}^{2}}}+{\frac{f\ln \left ( f{x}^{2}+d \right ) aB}{2\,{a}^{2}{f}^{2}-4\,acdf+2\,{b}^{2}df+2\,{c}^{2}{d}^{2}}}-{\frac{\ln \left ( f{x}^{2}+d \right ) Bcd}{2\,{a}^{2}{f}^{2}-4\,acdf+2\,{b}^{2}df+2\,{c}^{2}{d}^{2}}}+{\frac{Aa{f}^{2}}{{a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2}}\arctan \left ({fx{\frac{1}{\sqrt{df}}}} \right ){\frac{1}{\sqrt{df}}}}-{\frac{Acdf}{{a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2}}\arctan \left ({fx{\frac{1}{\sqrt{df}}}} \right ){\frac{1}{\sqrt{df}}}}+{\frac{Bbdf}{{a}^{2}{f}^{2}-2\,acdf+{b}^{2}df+{c}^{2}{d}^{2}}\arctan \left ({fx{\frac{1}{\sqrt{df}}}} \right ){\frac{1}{\sqrt{df}}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((B*x+A)/(c*x^2+b*x+a)/(f*x^2+d),x)

[Out]

1/2/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d^2)*ln(c*x^2+b*x+a)*A*b*f-1/2/(a^2*f^2-2*a*c
*d*f+b^2*d*f+c^2*d^2)*ln(c*x^2+b*x+a)*B*a*f+1/2/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d
^2)*c*ln(c*x^2+b*x+a)*B*d-2/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d^2)/(4*a*c-b^2)^(1/2
)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*a*c*f+1/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d
^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*b^2*f+2/(a^2*f^2-2*a
*c*d*f+b^2*d*f+c^2*d^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*A*
c^2*d-1/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d^2)/(4*a*c-b^2)^(1/2)*arctan((2*c*x+b)/(
4*a*c-b^2)^(1/2))*B*a*b*f-1/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d^2)/(4*a*c-b^2)^(1/2
)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*B*b*c*d-1/2*f/(a^2*f^2-2*a*c*d*f+b^2*d*f+c
^2*d^2)*ln(f*x^2+d)*A*b+1/2*f/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d^2)*ln(f*x^2+d)*a*
B-1/2/(a^2*f^2-2*a*c*d*f+b^2*d*f+c^2*d^2)*ln(f*x^2+d)*B*c*d+f^2/(a^2*f^2-2*a*c*d
*f+b^2*d*f+c^2*d^2)/(d*f)^(1/2)*arctan(x*f/(d*f)^(1/2))*a*A-f/(a^2*f^2-2*a*c*d*f
+b^2*d*f+c^2*d^2)/(d*f)^(1/2)*arctan(x*f/(d*f)^(1/2))*A*c*d+f/(a^2*f^2-2*a*c*d*f
+b^2*d*f+c^2*d^2)/(d*f)^(1/2)*arctan(x*f/(d*f)^(1/2))*B*b*d

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: ValueError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + d)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

_______________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + d)),x, algorithm="fricas")

[Out]

Timed out

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x+A)/(c*x**2+b*x+a)/(f*x**2+d),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.266682, size = 359, normalized size = 1.31 \[ \frac{{\left (B c d - B a f + A b f\right )}{\rm ln}\left (c x^{2} + b x + a\right )}{2 \,{\left (c^{2} d^{2} + b^{2} d f - 2 \, a c d f + a^{2} f^{2}\right )}} - \frac{{\left (B c d - B a f + A b f\right )}{\rm ln}\left (f x^{2} + d\right )}{2 \,{\left (c^{2} d^{2} + b^{2} d f - 2 \, a c d f + a^{2} f^{2}\right )}} + \frac{{\left (B b d f - A c d f + A a f^{2}\right )} \arctan \left (\frac{f x}{\sqrt{d f}}\right )}{{\left (c^{2} d^{2} + b^{2} d f - 2 \, a c d f + a^{2} f^{2}\right )} \sqrt{d f}} - \frac{{\left (B b c d - 2 \, A c^{2} d + B a b f - A b^{2} f + 2 \, A a c f\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (c^{2} d^{2} + b^{2} d f - 2 \, a c d f + a^{2} f^{2}\right )} \sqrt{-b^{2} + 4 \, a c}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((B*x + A)/((c*x^2 + b*x + a)*(f*x^2 + d)),x, algorithm="giac")

[Out]

1/2*(B*c*d - B*a*f + A*b*f)*ln(c*x^2 + b*x + a)/(c^2*d^2 + b^2*d*f - 2*a*c*d*f +
 a^2*f^2) - 1/2*(B*c*d - B*a*f + A*b*f)*ln(f*x^2 + d)/(c^2*d^2 + b^2*d*f - 2*a*c
*d*f + a^2*f^2) + (B*b*d*f - A*c*d*f + A*a*f^2)*arctan(f*x/sqrt(d*f))/((c^2*d^2
+ b^2*d*f - 2*a*c*d*f + a^2*f^2)*sqrt(d*f)) - (B*b*c*d - 2*A*c^2*d + B*a*b*f - A
*b^2*f + 2*A*a*c*f)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/((c^2*d^2 + b^2*d*f -
 2*a*c*d*f + a^2*f^2)*sqrt(-b^2 + 4*a*c))